package com.wizards.mtg.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.wizards.mtg.Payable;
import com.wizards.mtg.card.KeywordAbility;
import com.wizards.mtg.card.Subtype;
import com.wizards.mtg.card.Supertype;
import com.wizards.mtg.card.Type;

public class Util 
{	
	public static Set<Type> toSet(Type... types) {
		return (types == null || types.length == 0) ? null : new HashSet<Type>(Arrays.asList(types));
	}
	
	public static Set<Subtype> toSet(Subtype... subtypes) {
		return (subtypes == null || subtypes.length == 0) ? null : new HashSet<Subtype>(Arrays.asList(subtypes));
	}
	
	public static Set<Supertype> toSet(Supertype... supertypes) {
		return (supertypes == null || supertypes.length == 0) ? null : new HashSet<Supertype>(Arrays.asList(supertypes));
	}

	public static Set<KeywordAbility> toSet(KeywordAbility... abilities) {
		return (abilities == null || abilities.length == 0) ? null : new HashSet<KeywordAbility>(Arrays.asList(abilities));
	}

	public static List<Payable> toList(Payable... mana) {
	    return (mana == null || mana.length == 0) ? null : new ArrayList<Payable>(Arrays.asList(mana));
    }
}
